package entidades;

import java.util.Hashtable;

import javax.xml.bind.annotation.XmlRootElement;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

//import java.util.List;
@XmlRootElement(name="diassemana")
public class DiasSemana implements KvmSerializable{
	
	/**
	 * 
	 */
	
	//atributos
	private String dia;
	private int hora;
	
	//contructores
	public DiasSemana(String dia, int hora){
		this.dia=dia;
		this.hora=hora;
	}
	public DiasSemana(){
		/*this.dia=null;
		this.hora=0;*/
	}
	
	//getters y setters
	
	public String getDia() {
		return dia;
	}
	
	public void setDia(String dia) {
		this.dia = dia;
	}
	public int getHora() {
		return hora;
	}
	public void setHora(int hora) {
		this.hora = hora;
	}
	
	public String toString(){
		return String.format("Dias:%s\nHoras:%s",dia,hora);
		}
	@Override
	public Object getProperty(int arg0) {
		switch(arg0)
		{
		case 0:
			return dia;
		case 1:
			return hora;
		}
		
		return null;
	}
	@Override
	public int getPropertyCount() {
		// TODO Auto-generated method stub
		return 2;
	}
	@Override
	public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo arg2) {

		switch(index)
		{
		case 0:
			arg2.type = PropertyInfo.STRING_CLASS;
			arg2.name = "Dia";
			break;
		case 1:
			arg2.type = PropertyInfo.INTEGER_CLASS;
			arg2.name = "Hora";
		}
		
	}
	@Override
	public void setProperty(int index, Object arg1) {
		
		switch(index)
		{
		case 0:
			this.dia = arg1.toString();
			break;
		case 1:
			this.hora = Integer.parseInt(arg1.toString());
			
		}
	}
	
	
	

}
